<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>盘盈盘亏管理</title>
    <link rel="stylesheet" type="text/css" href="ui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="ui/themes/icon.css">
    <script type="text/javascript" src="ui/jquery.min.js"></script>
    <script type="text/javascript" src="ui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="ui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="ui/jquery.serializejson.min.js"></script>
    <script type="text/javascript" src="ui/date.js"></script>
    <script type="text/javascript" src="js/crud.js"></script>
    <script type="text/javascript" src="ui/download.js"></script>
    <script type="text/javascript">
        var name = "erp/inventory";
        // var stateValue;
        var columns = [[
            {field: 'uuid', title: '编号', width: 100},
            {field: 'goodsName', title: '商品', width: 100},
            {field: 'storeName', title: '仓库', width: 100},
            {field: 'num', title: '数量', width: 100},
            {field: 'type', title: '类型', width: 100,formatter:function(value, row, index){
                    value = row.type;
                    //0：盘亏 1：盘盈
                    if(0 == value * 1){
                        return '盘亏';
                    }
                    if(1 == value * 1){
                        return '盘盈';
                    }
                }},
            {field: 'createtime', title: '登记日期', width: 100,

                formatter:function(value){
                    return value ? new Date(value).Format("yyyy-MM-dd") : '';
                }},
            {field: 'checktime', title: '审核日期', width: 100,formatter:function(value){
                    return value ? new Date(value).Format("yyyy-MM-dd") : '';
                }},
            {field: 'createrName', title: '登记人', width: 100},
            {field: 'checkerName', title: '审核人', width: 100},
            {field: 'state', title: '状态', width: 100,formatter:function(stateValue, row, index){
                    stateValue = row.state;
                    if(0 == stateValue * 1){
                        return '未审核';
                    }
                    if(1 == stateValue * 1){
                        return '已审核';
                    }
                }},
            {field: 'remark', title: '备注', width: 100},

            {
                field: '-', title: '操作', width: 200, formatter: function (value, row, index) {
                    stateValue = row.state;
                    if (0 == stateValue * 1) {
                    var oper = "<a href=\"javascript:void(0)\" onclick=\"edit(" + row.uuid + ')">修改</a>';
                    oper += ' <a href="javascript:void(0)" onclick="del(' + row.uuid + ')">删除</a>';
                    oper += ' <a href="javascript:void(0)" onclick="doCheck(' + row.uuid + ')">审核</a>';
                    return oper;}
                }
            }
        ]];



    </script>
</head>
<body>
<div class="easyui-panel" style="padding-left:4px;border-bottom:0px;">
    <div style="height:2px;"></div>
        <form id="searchForm">


            登记日期：<input name="createFrom" class="easyui-datebox" editable="false"> 到 <input name="createTo" class="easyui-datebox" editable="false">
            审核日期：<input name="checkFrom" class="easyui-datebox" editable="false"> 到 <input name="checkTo" class="easyui-datebox" editable="false">
            <br>
            数量:<input name="numMin">~<input name="numMax">
            类型：<input name="type" type="radio" value="">全部
            <input name="type" type="radio" value="0">盘亏
            <input name="type" type="radio" value="1">盘盈

            &nbsp;状态：<input name="state" type="radio" value="">全部
            <input name="state" type="radio" value="0">未审核
            <input name="state" type="radio" value="1">已审核

            <button type="button" id="btnSearch">查询</button>
            <button type="button" id="clearbtn">清空</button>

    </form>
    <div style="height:2px;"></div>
</div>
<table id="grid"></table>


<div id="editDlg" style="width: 300px">
    <form id="editForm">
        <input name="uuid" type="hidden">

        <table>
            <tr>
                <td>商品</td>
                <td><input name="goodsuuid" class="easyui-combobox" data-options="
				url: 'erp/goods/findAll',valueField:'uuid',textField:'name'
			"></td>
            </tr>
            <tr>
                <td>仓库</td>
                <td><input name="storeuuid" class="easyui-combobox" data-options="
				url: 'erp/store/findAllStore', valueField:'uuid', textField:'name'
			"></td>
            </tr>
            <tr>
                <td>数量</td>
                <td><input name="num"></td>
            </tr>
            <tr>
                <td>类型</td>
                <td><input name="type" type="radio" value="0">盘亏
                    <input name="type" type="radio" value="1">盘盈</td>
            </tr>
            <tr>
                <td>备注</td>
                <td><input name="remark"></td>
            </tr>

        </table>
        <button id="btnSave" type="button">保存</button>
    </form>
</div>






</body>
</html>
